﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<link rel="stylesheet" type="text/css" href="style/style.css" title="Default" media="screen" />
	<title>IMAREC - Image Recognition Software</title>
	<script src="scripts/PopBox.js" type="text/javascript"></script>
	<script type="text/javascript">
		popBoxWaitImage.src = "style/spinner40.gif";
		popBoxRevertImage = "style/magminus.gif";
		popBoxPopImage = "style/magplus.gif";
	</script>
</head>

<body>
	<div id="header">
		<div id="topBorder">
			<div id="topLeftCorner"></div>
			<div id="topCenterBorder"></div>
			<div id="topRightCorner"></div>
		</div>
		<div id="leftBorder"></div>
		<div id="page">
			<div id="leftColumn">
				<img src="style/logo.png" alt="IMAREC logo"/>
				<ul>
					<li><a href="<s:url action="home" namespace="/" />"><s:text name="main.home" /></a></li> <!-- Dodaj lub wyszukaj -->
					<li><a href="<s:url action="listPhotos" namespace="/" />" id="active"><s:text name="main.gallery" /></a></li> <!-- Galeria -->
				</ul>
			</div>
			<div id="rightColumn">
				<s:bean name="org.apache.struts2.util.Counter" var="counter">
					<s:param name="last" value="%{photoListSize}"/>
				</s:bean>
				
				<s:iterator value="photoList" status="status" >
					
					<s:url action="getPhoto" namespace="/" var="photo">
						<s:param name="imageId" value="%{id}"/>
					</s:url>
					
					<s:url action="getThumb" namespace="/" var="thumb">
						<s:param name="imageId" value="%{id}"/>
					</s:url>
				
					<div class="image">
						<img id="img<s:property value="%{id}" />"
							alt="<s:property value="title" />"
							pbsrc="<s:property value="photo" />"
							src="<s:property value="thumb" />"
							pbCaption="<s:property value="title" />"
							class="PopBoxImageSmall"
							onclick="Pop(this,100,'PopBoxImageLarge');" />
						<p class="imgDescription"><s:property value="title" /></p>
					</div>
					
				</s:iterator>
				
				<s:bean name="org.apache.struts2.util.Counter" var="counter">
					<s:param name="last" value="%{pages}"/>
				</s:bean>
			</div>
			
			<div id="imagePages">
				<s:iterator value="#counter" status="status" >
					<s:url action="listPhotos" namespace="/" var="list">
						<s:param name="page" value="%{#status.index + 1}"/>
					</s:url>
							
					<a href="<s:property value="list" />"><s:property value="#status.index + 1" /></a>
				</s:iterator>
			</div>
		</div>
		<div id="rightBorder"></div>
	</div>
	<div id="footer">
		<div id="footerPos">
			<div id="footerLeftBorder"></div>
			<div id="bar"></div>
			<div id="footerRightBorder"></div>
		</div>
	</div>
	
	<script type="text/javascript">
		<!--
		var height = ((document.getElementById('page').offsetHeight) + 'px');
		document.getElementById('leftBorder').style.height = height;
		document.getElementById('rightBorder').style.height = height;
		-->
	</script>
	
</body>
</html>